<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>07_数学对象-round, floor,ceil</title>
    </head>
    <body>
        <script>
            // round, floor,ceil

            // round-四舍五入 取整
            // console.log(Math.round(1.4));
            // console.log(Math.round(1.5));
            // console.log(Math.round(1.6));

            // console.log(Math.round(-1.4));
            // console.log(Math.round(-1.6));
            // console.log(Math.round(-1.5));


            // floor 向下取整
            // console.log(Math.floor(1.4));
            // console.log(Math.floor(1.5));
            // console.log(Math.floor(1.6));

            // console.log(Math.floor(-1.4));
            // console.log(Math.floor(-1.5));
            // console.log(Math.floor(-1.6));


            // ceil 向上取整
            console.log(Math.ceil(1.4));
            console.log(Math.ceil(1.5));
            console.log(Math.ceil(1.6));

            console.log(Math.ceil(-1.4));
            console.log(Math.ceil(-1.5));
            console.log(Math.ceil(-1.6));








        </script>
    </body>
</html>